package com.eighth.observer.origin;

import java.util.Observable;
import java.util.Observer;


public class UserInfo implements Observer {
    private String name;

    UserInfo(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println("[" + name + "]收到消息：" + ((MessageInfo) o).getMessage());
    }
}
